<template>
  <div class="outer">
    <h1>我是header的数据</h1>
    <h1>{{count}}</h1>
    <button @click="incrementNWait({n:3})">点击等2秒加n</button>
    <button @click="getMovieList">点击获取电影列表</button>
    <ul>
      <li v-for="item in movieList" :key="item.tvid">{{item.albumName}}</li>
    </ul>
    

  </div>
</template>

<script>
import { mapActions, mapState } from 'vuex';
export default {
  name: "Header",
  computed:{
    ...mapState(['count','movieList'])
  },
  methods:{
    incrementNWait(payload){
      this.$store.dispatch('incrementNWait',payload)
    },
    // getmovieList(){
    //   this.$store.dispatch('getMovieList')
    // },
    ...mapActions(['getMovieList'])
  }

};
</script>

<style scoped>
.outer {
  background: green;

}
</style>